package com.ls.mysql.quartz.service;

import com.ls.mysql.quartz.entity.Quartz;
import com.ls.mysql.quartz.entity.ScheduleJob;
import org.quartz.SchedulerException;

import java.util.List;

/**
 * @Author Maple.Chen
 * @Description 任务调度方法接口
 * @Date 21:06 2020/5/28
 **/
public interface SchedulerService {
    // 添加任务
    public String createJob(Quartz quartz) throws SchedulerException, ClassNotFoundException;

    // 删除任务
    public String deleteJob(String jobName, String jobGroup) throws SchedulerException;

    // 暂停任务
    public boolean pauseJob(String jobName, String jobGroup) throws SchedulerException;

    // 恢复所有任务
    public void resumeAllJob() throws SchedulerException;

    // 查询任务状态
    public String retrieveJobState(String jobName, String jobGroup) throws SchedulerException;

    // 停止所有任务
    public void stopAllJob() throws SchedulerException;

    // 恢复某个任务
    public boolean resumeJob(String jobName, String jobGroup) throws SchedulerException;

    // 修改某个任务
    public String updateJob(Quartz quartz) throws SchedulerException;

    // 获取计划表中的所有任务
    public List<ScheduleJob> getAllJob() throws SchedulerException;

}
